﻿using Dapper;
using System;
using BCEntity.HelpDocument.HelpDocumentation;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;

namespace BCData.HelpDocument.HelpDocumentation
{
    /// <summary>
    /// 帮助
    /// </summary>
    public interface IHelpDocumentationData
    {
        #region  成员方法
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="helpDocumentationId">帮助文档</param>
        Task<bool> Exists(long helpDocumentationId);
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="documentCode">帮助文档码</param>
        Task<bool> Exists(string documentCode);
        /// <summary>
        /// 增加帮助
        /// </summary>
        /// <param name="entity">帮助信息</param>
        Task<HelpDocumentationEntity> Add(HelpDocumentationEntity entity);
        /// <summary>
        /// 更新帮助
        /// </summary>
        /// <param name="entity">帮助信息</param>
        Task<HelpDocumentationEntity> Update(HelpDocumentationEntity entity);
        /// <summary>
        /// 删除帮助
        /// </summary>
        /// <param name="helpDocumentationId">帮助文档</param>
        Task<bool> Delete(long helpDocumentationId);
        /// <summary>
        /// 获取帮助
        /// </summary>
        /// <param name="helpDocumentationId">帮助文档</param>
        Task<HelpDocumentationEntity> GetEntity(long helpDocumentationId);
        /// <summary>
        /// 获取帮助
        /// </summary>
        /// <param name="documentCode">帮助文档编码</param>
        Task<HelpDocumentationEntity> GetEntity(string documentCode);
        /// <summary>
        /// 获取帮助列表
        /// </summary>
        /// <param name="helpDocumentCategoryId">帮助文档分类Id</param>
        Task<IEnumerable<HelpDocumentationEntity>> GetList(long helpDocumentCategoryId);
        /// <summary>
        /// 获取帮助分页列表
        /// </summary>
        /// <param name="helpDocumentCategoryId">帮助文档分类Id</param>
        /// <param name="searchKey">查询内容</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="sortName">排序字段</param>
        /// <param name="ascending">升序</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        Task<(IEnumerable<HelpDocumentationEntity>, int)> Query(long? helpDocumentCategoryId, string searchKey, DateTime? start, DateTime? end, string sortName, bool? ascending, int pageIndex, int pageSize);
        #endregion  成员方法
    }


}